package com.lin.service;

import com.lin.mapper.BookMapper;
import com.lin.pojo.Books;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookServiceImpl implements BookService{
    private BookMapper bookMapper;

    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    @Override
    public int insertBook(Books books) {
        return bookMapper.insertBook(books);
    }

    @Override
    public int deleteBook(int id) {
        return bookMapper.deleteBook(id);
    }

    @Override
    public int updateBook(Books books) {
        return bookMapper.updateBook(books);
    }

    @Override
    public List<Books> selectAll() {
        return bookMapper.selectAll();
    }

    @Override
    public Books selectById(int id) {
        return bookMapper.selectById(id);
    }

    @Override
    public List<Books> selectBookByName(String bookName){return bookMapper.selectBookByName(bookName);}
}
